package org.xcorpio.java8.chapter09;

/**
 * Default method's resolution mechanism is pretty simple if a class inherits
 * from  several methods with the same signature. You just need to follow three 
 * rules systematically to solve all possible conflicts:
 * 
 * First, an explicit method declaration in the class or a superclass takes priority
 * over any default method declaration.
 * Otherwise, the method with the same signature in the most specific default-providing
 * interface is selected.
 * Finally, if there's still a conflict, you have to explicitly override the default
 * methods and choose which one your class should use.
 */
public class DiamondD implements DiamondB, DiamondC {

    public void hello() {
        System.out.println("Hello from class D");
    }

    public static void main(String[] args) {
        DiamondD d = new DiamondD();
        d.hello();
    }
}
